//
//  HLHomepageCell.m
//  zhuanxian
//
//  Created by zhaoliang chen on 2017/11/17.
//  Copyright © 2017年 huiling. All rights reserved.
//

#import "HLHomepageCell.h"

@implementation HLHomepageCell

+ (NSString *)cellIdentifier {
    return @"HLHomepageCell";
}

+ (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
    HLHomepageCell *cell = (HLHomepageCell*)[collectionView dequeueReusableCellWithReuseIdentifier:[HLHomepageCell cellIdentifier] forIndexPath:indexPath];
    return cell;
}

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.contentView.backgroundColor = [UIColor whiteColor];
        
        [self.contentView addSubview:self.imgVBusiness];
        [self.imgVBusiness mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.mas_equalTo(self.contentView);
            make.top.mas_equalTo(10);
            make.bottom.mas_equalTo(self.contentView.mas_centerY).offset(5);
            make.width.mas_equalTo(self.imgVBusiness.mas_height);
        }];
        
        [self.contentView addSubview:self.labelBusiness];
        [self.labelBusiness mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.mas_equalTo(self.contentView);
            make.top.mas_equalTo(self.contentView.mas_centerY).offset(20);
        }];
    }
    return self;
}

- (UIImageView*)imgVBusiness {
    if (!_imgVBusiness) {
        _imgVBusiness = [[UIImageView alloc]init];
        _imgVBusiness.contentMode = UIViewContentModeScaleAspectFill;
    }
    return _imgVBusiness;
}

- (UILabel*)labelBusiness {
    if (!_labelBusiness) {
        _labelBusiness = [[UILabel alloc]init];
        _labelBusiness.font = [UIFont systemFontOfSize:13];
        _labelBusiness.textAlignment = NSTextAlignmentCenter;
    }
    return _labelBusiness;
}

@end
